package com.onpositive.mediawiki.deserializing;

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;

import com.onpositive.commons.xml.language.DOMEvaluator;
import com.onpositive.dataminer.core.DataProviderConfig;
import com.onpositive.dataminer.core.IDataProviderConfigurator;
import com.onpositive.mediawiki.dataminer.MediaWikiDataProvider;
import com.onpositive.semantic.model.binding.Binding;
import com.onpositive.semantic.model.ui.generic.IDisplayable;

public class SerializedStorageConfigurator implements IDataProviderConfigurator {

	public SerializedStorageConfigurator() {
	}

	@Override
	public boolean configure(DataProviderConfig config) {
		try {
			FileDialog fileDialog = new FileDialog( Display.getCurrent().getActiveShell() ) ;
			fileDialog.setFilterPath("C:/workspaces/runtime-com.onpositive.dataminer.rcp.application/.metadata/.plugins/serialized") ;
			String filePath = fileDialog.open() ;
			
			config.setUrl( filePath ) ; 
			
			return filePath != null;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return true;
	}

}
